export default{
  chooseImg:(res)=>{
    let ipt=document.getElementById('uploadImg1579')
    if(!ipt){
      ipt =document.createElement('input')
      ipt.setAttribute('type','file')
      ipt.setAttribute('ref','file')
      ipt.setAttribute('id','uploadImg1579')
      ipt.setAttribute('multiple','true')
      ipt.setAttribute('accept','image/*')
      ipt.style.display="none"
      document.documentElement.appendChild(ipt)
    }
    ipt.onchange=res
    ipt.click()
  },

  showModal:(opt)=>{
    let body=document.documentElement
    
    body.innerHTML=`<div style="width: 80%;border: 1px solid #f7f7f7;text-align: center;position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);background: #fff;box-shadow: 0 0 2px 2px #e2e2e2;border-radius: 20rem;font-size: 40rem;"><div style="    padding: 30rem;border-bottom: 1px solid #c7c5c5;">提示</div><div style="    padding: 40rem;border-bottom: 1px solid #c7c5c5;">123456789</div><div style="    display: flex;">        <div style="    flex: 1;padding: 30rem;border-right: 1px solid #f8f8f8;">确定</div><div style="    flex: 1;padding: 30rem;border-right: 1px solid #f8f8f8;">取消</div></div></div>`

  },

  scroll_bottom:(el,Fn,ready)=>{
    if(!ready) return
      let e=this.$refs.scroll
      if(e.scrollHeight - e.scrollTop <= e.clientHeight+1){
          this.Fn()
        // return
      }
    }

}